home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / AOCE folder / OCE.lisp < prev    next >
Encoding:
Text File  |  1994-09-12  |  61.8 KB  |  1,624 lines  |  [TEXT/CCL2]

  1.  
  2. (in-package :TRAPS)             ; ***********************************************************
  3. ; Created: Monday, November 8, 1993 11:28 AM
  4. ;  OCE.p
  5. ;  Pascal Interface to the Macintosh Libraries
  6. ;   Copyright Apple Computer, Inc. 1990-1993
  7. ;   All rights reserved
  8. ; ***********************************************************
  9.  
  10. ; $IFC UNDEFINED UsingIncludes
  11. ; $SETC UsingIncludes:= 0
  12. ; $ENDC
  13.  
  14. ; $IFC NOT UsingIncludes
  15.  
  16. ; $ENDC
  17.  
  18. ; $IFC UNDEFINED UsingOCE
  19. ; $SETC UsingOCE:= 1
  20.  
  21. ; $I+
  22. ; $SETC OCEIncludes:= UsingIncludes
  23. ; $SETC UsingIncludes:= 1
  24.  
  25. ; $IFC UNDEFINED UsingAliases
  26.  
  27. (require-interface 'ALIASES)    ; $I $$Shell(PInterfaces)Aliases.p;  for AliasPtr 
  28. ; $ENDC
  29.  
  30. ; $IFC UNDEFINED UsingAppleEvents
  31.  
  32. (require-interface 'APPLEEVENTS); $I $$Shell(PInterfaces)AppleEvents.p;  for DescType 
  33. ; $ENDC
  34.  
  35. ; $IFC UNDEFINED UsingScript
  36.  
  37. (require-interface 'SCRIPT)     ; $I $$Shell(PInterfaces)Script.p;  for smRoman 
  38. ; $ENDC
  39.  
  40. ; $IFC UNDEFINED UsingTypes
  41.  
  42. (require-interface 'TYPES)      ; $I $$Shell(PInterfaces)Types.p
  43. ; $ENDC
  44.  
  45. ; $SETC UsingIncludes:= OCEIncludes
  46.  
  47. ; All utility routines defined here are callable at interrupt level.  Currently,
  48. ; this is done at the expense of not using the international utilities package
  49. ; for STRING comparisons (we just use the ROM-based RelString trap).
  50.  
  51. ; Defines for the trap selector values.
  52. ; Note:  Some selector values also chosen from this same range of numbers appear
  53. ; in the file OCEMessaging.h.  Check there before you add a new value.
  54.  
  55. (defconstant $kOCECopyCreationID 768)
  56. (defconstant $kOCECopyDirDiscriminator 769)
  57. (defconstant $kOCECopyLocalRecordID 770)
  58. (defconstant $kOCECopyPackedDSSpec 771)
  59. (defconstant $kOCECopyPackedPathName 772)
  60. (defconstant $kOCECopyPackedRLI 773)
  61. (defconstant $kOCECopyPackedRecordID 774)
  62. (defconstant $kOCECopyRLI 775)
  63. (defconstant $kOCECopyRString 776)
  64. (defconstant $kOCECopyRecordID 777)
  65. (defconstant $kOCECopyShortRecordID 778)
  66. (defconstant $kOCEDuplicateRLI 779)
  67. (defconstant $kOCEEqualCreationID 780)
  68. (defconstant $kOCEEqualDirDiscriminator 781)
  69. (defconstant $kOCEEqualDSSpec 782)
  70. (defconstant $kOCEEqualLocalRecordID 783)
  71. (defconstant $kOCEEqualPackedDSSpec 784)
  72. (defconstant $kOCEEqualPackedPathName 785)
  73. (defconstant $kOCEEqualPackedRecordID 786)
  74. (defconstant $kOCEEqualPackedRLI 787)
  75. (defconstant $kOCEEqualRecordID 788)
  76. (defconstant $kOCEEqualRLI 789)
  77. (defconstant $kOCEEqualRString 790)
  78. (defconstant $kOCEEqualShortRecordID 791)
  79. (defconstant $kOCEExtractAlias 792)
  80. (defconstant $kOCEGetDSSpecInfo 793)
  81. (defconstant $kOCEGetIndAttributeType 794)
  82. (defconstant $kOCEGetIndRecordType 795)
  83. (defconstant $kOCEGetXtnType 796)
  84. (defconstant $kOCEIsNullPackedPathName 797)
  85. (defconstant $kOCENewLocalRecordID 798)
  86. (defconstant $kOCENewRLI 799)
  87. (defconstant $kOCENewRecordID 800)
  88. (defconstant $kOCENewShortRecordID 801)
  89. (defconstant $kOCEPackDSSpec 802)
  90. (defconstant $kOCEPackPathName 803)
  91. (defconstant $kOCEPackRLI 804)
  92. (defconstant $kOCEPackRLIParts 805)
  93. (defconstant $kOCEPackRecordID 806)
  94. (defconstant $kOCEPackedDSSpecSize 807)
  95. (defconstant $kOCEPackedPathNameSize 808)
  96. (defconstant $kOCEPackedRLIPartsSize 809)
  97. (defconstant $kOCEPackedRLISize 810)
  98. (defconstant $kOCEPackedRecordIDSize 811)
  99. (defconstant $kOCEDNodeNameCount 812)
  100. (defconstant $kOCERelRString 813)
  101. (defconstant $kOCESetCreationIDtoNull 814)
  102. (defconstant $kOCEUnpackDSSpec 815)
  103. (defconstant $kOCEUnpackPathName 816)
  104. (defconstant $kOCEUnpackRLI 817)
  105. (defconstant $kOCEUnpackRecordID 818)
  106. (defconstant $kOCEValidPackedDSSpec 819)
  107. (defconstant $kOCEValidPackedPathName 820)
  108. (defconstant $kOCEValidPackedRecordID 821)
  109. (defconstant $kOCEValidPackedRLI 822)
  110. (defconstant $kOCEValidRLI 823)
  111. (defconstant $kOCEValidRString 824)
  112. (defconstant $kOCECToRString 825)
  113. (defconstant $kOCEPToRString 826)
  114. (defconstant $kOCERToPString 827)
  115. (defconstant $kOCEPathFinderCID 828)
  116. (defconstant $kOCEStreamPackedDSSpec 829)
  117.  
  118. (defconstant $kOCENullCID 836)
  119. (defconstant $kOCEGetAccessControlDSSpec 837)
  120. (defconstant $kOCEGetRootPackedRLI 838)
  121.  
  122. (def-mactype :OCERECORDTYPEINDEX (find-mactype :SIGNED-INTEGER))
  123. (def-mactype :OCEATTRIBUTETYPEINDEX (find-mactype :SIGNED-INTEGER))
  124.  
  125. ; All these standard definitions begin with the Apple symbol (not shown here).
  126. ; NOTE:  To access these, you must call OCEGetIndRecordType or OCEGetIndAttributeType
  127. ; with the proper index.  These routines return pointers to the standard type.
  128. ; This was done so that code fragments (INITs, CDEVs, DSAMs, etc). which cannot
  129. ; use global data can also use these.
  130.  
  131. ;  Indices for the standard definitions for certain record types (OCERecordTypeIndex): 
  132.  
  133. (defconstant $kUserRecTypeNum 1);  "User" 
  134. (defconstant $kGroupRecTypeNum 2);  "Group" 
  135. (defconstant $kMnMRecTypeNum 3) ;  "AppleMail™ M&M" 
  136. (defconstant $kMnMForwarderRecTypeNum 4);  "AppleMail™ Fwdr" 
  137. (defconstant $kNetworkSpecRecTypeNum 5);  "NetworkSpec" 
  138. (defconstant $kADAPServerRecTypeNum 6);  "ADAP Server" 
  139. (defconstant $kADAPDNodeRecTypeNum 7);  "ADAP DNode" 
  140. (defconstant $kADAPDNodeRepRecTypeNum 8);  "ADAP DNode Rep" 
  141. (defconstant $kServerSetupRecTypeNum 9);  "Server Setup" 
  142. (defconstant $kDirectoryRecTypeNum 10);  "Directory" 
  143. (defconstant $kDNodeRecTypeNum 11);  "DNode" 
  144. (defconstant $kSetupRecTypeNum 12);  "Setup" 
  145. (defconstant $kMSAMRecTypeNum 13);  "MSAM" 
  146. (defconstant $kDSAMRecTypeNum 14);  "DSAM" 
  147. (defconstant $kAttributeValueRecTypeNum 15);  "Attribute Value" 
  148. (defconstant $kBusinessCardRecTypeNum 16);  "Business Card" 
  149. (defconstant $kMailServiceRecTypeNum 17);  "Mail Service" 
  150. (defconstant $kCombinedRecTypeNum 18);  "Combined" 
  151. (defconstant $kOtherServiceRecTypeNum 19);  "Other Service" 
  152. (defconstant $kAFPServiceRecTypeNum 20);  "Other Service afps" 
  153.  
  154. (defconstant $kFirstOCERecTypeNum #$KUSERRECTYPENUM);  first standard OCE record type 
  155. (defconstant $kLastOCERecTypeNum #$KAFPSERVICERECTYPENUM);  last standard OCE record type 
  156. (defconstant $kNumOCERecTypes (- #$KLASTOCERECTYPENUM (+ #$KFIRSTOCERECTYPENUM 1)))
  157.  
  158. ;  Indices for the standard definitions for certain attribute types (OCEAttributeTypeIndex): 
  159.  
  160. (defconstant $kMemberAttrTypeNum 1001);  "Member" 
  161. (defconstant $kAdminsAttrTypeNum 1002);  "Administrators" 
  162. (defconstant $kMailSlotsAttrTypeNum 1003);  "mailslots" 
  163. (defconstant $kPrefMailAttrTypeNum 1004);  "pref mailslot" 
  164. (defconstant $kAddressAttrTypeNum 1005);  "Address" 
  165. (defconstant $kPictureAttrTypeNum 1006);  "Picture" 
  166. (defconstant $kAuthKeyAttrTypeNum 1007);  "auth key" 
  167. (defconstant $kTelephoneAttrTypeNum 1008);  "Telephone" 
  168. (defconstant $kNBPNameAttrTypeNum 1009);  "NBP Name" 
  169. (defconstant $kQMappingAttrTypeNum 1010);  "ForwarderQMap" 
  170. (defconstant $kDialupSlotAttrTypeNum 1011);  "DialupSlotInfo" 
  171. (defconstant $kHomeNetAttrTypeNum 1012);  "Home Internet" 
  172. (defconstant $kCoResAttrTypeNum 1013);  "Co-resident M&M" 
  173. (defconstant $kFwdrLocalAttrTypeNum 1014);  "FwdrLocalRecord" 
  174. (defconstant $kConnectAttrTypeNum 1015);  "Connected To" 
  175. (defconstant $kForeignAttrTypeNum 1016);  "Foreign RLIs" 
  176. (defconstant $kOwnersAttrTypeNum 1017);  "Owners" 
  177. (defconstant $kReadListAttrTypeNum 1018);  "ReadList" 
  178. (defconstant $kWriteListAttrTypeNum 1019);  "WriteList" 
  179. (defconstant $kDescriptorAttrTypeNum 1020);  "Descriptor" 
  180. (defconstant $kCertificateAttrTypeNum 1021);  "Certificate" 
  181. (defconstant $kMsgQsAttrTypeNum 1022);  "MessageQs" 
  182. (defconstant $kPrefMsgQAttrTypeNum 1023);  "PrefMessageQ" 
  183. (defconstant $kMasterPFAttrTypeNum 1024);  "MasterPF" 
  184. (defconstant $kMasterNetSpecAttrTypeNum 1025);  "MasterNetSpec" 
  185. (defconstant $kServersOfAttrTypeNum 1026);  "Servers Of" 
  186. (defconstant $kParentCIDAttrTypeNum 1027);  "Parent CID" 
  187. (defconstant $kNetworkSpecAttrTypeNum 1028);  "NetworkSpec" 
  188. (defconstant $kLocationAttrTypeNum 1029);  "Location" 
  189. (defconstant $kTimeSvrTypeAttrTypeNum 1030);  "TimeServer Type" 
  190. (defconstant $kUpdateTimerAttrTypeNum 1031);  "Update Timer" 
  191. (defconstant $kShadowsOfAttrTypeNum 1032);  "Shadows Of" 
  192. (defconstant $kShadowServerAttrTypeNum 1033);  "Shadow Server" 
  193. (defconstant $kTBSetupAttrTypeNum 1034);  "TB Setup" 
  194. (defconstant $kMailSetupAttrTypeNum 1035);  "Mail Setup" 
  195. (defconstant $kSlotIDAttrTypeNum 1036);  "SlotID" 
  196. (defconstant $kGatewayFileIDAttrTypeNum 1037);  "Gateway FileID" 
  197. (defconstant $kMailServiceAttrTypeNum 1038);  "Mail Service" 
  198. (defconstant $kStdSlotInfoAttrTypeNum 1039);  "Std Slot Info" 
  199. (defconstant $kAssoDirectoryAttrTypeNum 1040);  "Asso. Directory" 
  200. (defconstant $kDirectoryAttrTypeNum 1041);  "Directory" 
  201. (defconstant $kDirectoriesAttrTypeNum 1042);  "Directories" 
  202. (defconstant $kSFlagsAttrTypeNum 1043);  "SFlags" 
  203. (defconstant $kLocalNameAttrTypeNum 1044);  "Local Name" 
  204. (defconstant $kLocalKeyAttrTypeNum 1045);  "Local Key" 
  205. (defconstant $kDirUserRIDAttrTypeNum 1046);  "Dir User RID" 
  206. (defconstant $kDirUserKeyAttrTypeNum 1047);  "Dir User Key" 
  207. (defconstant $kDirNativeNameAttrTypeNum 1048);  "Dir Native Name" 
  208. (defconstant $kCommentAttrTypeNum 1049);  "Comment" 
  209. (defconstant $kRealNameAttrTypeNum 1050);  "Real Name" 
  210. (defconstant $kPrivateDataAttrTypeNum 1051);  "Private Data" 
  211. (defconstant $kDirTypeAttrTypeNum 1052);  "Directory Type" 
  212. (defconstant $kDSAMFileAliasAttrTypeNum 1053);  "DSAM File Alias" 
  213. (defconstant $kCanAddressToAttrTypeNum 1054);  "Can Address To" 
  214. (defconstant $kDiscriminatorAttrTypeNum 1055);  "Discriminator" 
  215. (defconstant $kAliasAttrTypeNum 1056);  "Alias" 
  216. (defconstant $kParentMSAMAttrTypeNum 1057);  "Parent MSAM" 
  217. (defconstant $kParentDSAMAttrTypeNum 1058);  "Parent DSAM" 
  218. (defconstant $kSlotAttrTypeNum 1059);  "Slot" 
  219. (defconstant $kAssoMailServiceAttrTypeNum 1060);  "Asso. Mail Service" 
  220. (defconstant $kFakeAttrTypeNum 1061);  "Fake" 
  221. (defconstant $kInheritSysAdminAttrTypeNum 1062);  "Inherit SysAdministrators" 
  222. (defconstant $kPreferredPDAttrTypeNum 1063);  "Preferred PD" 
  223. (defconstant $kLastLoginAttrTypeNum 1064);  "Last Login" 
  224. (defconstant $kMailerAOMStateAttrTypeNum 1065);  "Mailer AOM State" 
  225. (defconstant $kMailerSendOptionsAttrTypeNum 1066);  "Mailer Send Options" 
  226. (defconstant $kJoinedAttrTypeNum 1067);  "Joined" 
  227. (defconstant $kUnconfiguredAttrTypeNum 1068);  "Unconfigured" 
  228. (defconstant $kVersionAttrTypeNum 1069);  "Version" 
  229. (defconstant $kLocationNamesAttrTypeNum 1070);  "Location Names" 
  230. (defconstant $kActiveAttrTypeNum 1071);  "Active" 
  231. (defconstant $kDeleteRequestedAttrTypeNum 1072);  "Delete Requested" 
  232. (defconstant $kGatewayTypeAttrTypeNum 1073);  "Gateway Type" 
  233.  
  234. (defconstant $kFirstOCEAttrTypeNum #$KMEMBERATTRTYPENUM);  first standard OCE attr type 
  235. (defconstant $kLastOCEAttrTypeNum #$KGATEWAYTYPEATTRTYPENUM);  last standard OCE attr type 
  236. (defconstant $kNumOCEAttrTypes (- #$KLASTOCEATTRTYPENUM (+ #$KFIRSTOCEATTRTYPENUM 1)))
  237.  
  238. ;  For anyone who absolutely needs a define of the body of the standard record or
  239. ; attribute type, use these below.  CAUTION!  All the types below are assumed to be
  240. ; in character set 'smRoman'.  If you try to compare these to some RString or
  241. ; AttributeType variable, you must take the character set code into account.  Future
  242. ; standard types may be defined using character sets other than 'smRoman'.  The
  243. ; first character of each of these is $F0, the Apple symbol.
  244.  
  245. ;  Standard definitions for certain record types: 
  246.  
  247. (defconstant $kUserRecTypeBody "aoce User")
  248. (defconstant $kGroupRecTypeBody "aoce Group")
  249. (defconstant $kMnMRecTypeBody "aoce AppleMail™ M&M")
  250. (defconstant $kMnMForwarderRecTypeBody "aoce AppleMail™ Fwdr")
  251. (defconstant $kNetworkSpecRecTypeBody "aoce NetworkSpec")
  252. (defconstant $kADAPServerRecTypeBody "aoce ADAP Server")
  253. (defconstant $kADAPDNodeRecTypeBody "aoce ADAP DNode")
  254. (defconstant $kADAPDNodeRepRecTypeBody "aoce ADAP DNode Rep")
  255. (defconstant $kServerSetupRecTypeBody "aoce Server Setup")
  256. (defconstant $kDirectoryRecTypeBody "aoce Directory")
  257. (defconstant $kDNodeRecTypeBody "aoce DNode")
  258. (defconstant $kSetupRecTypeBody "aoce Setup")
  259. (defconstant $kMSAMRecTypeBody "aoce MSAM")
  260. (defconstant $kDSAMRecTypeBody "aoce DSAM")
  261. (defconstant $kAttributeValueRecTypeBody "aoce Attribute Value")
  262. (defconstant $kBusinessCardRecTypeBody "aoce Business Card")
  263. (defconstant $kMailServiceRecTypeBody "aoce Mail Service")
  264. (defconstant $kCombinedRecTypeBody "aoce Combined")
  265. (defconstant $kOtherServiceRecTypeBody "aoce Other Service")
  266. (defconstant $kAFPServiceRecTypeBody "aoce Other Service afps")
  267.  
  268. ;  Standard definitions for certain attribute types: 
  269.  
  270. (defconstant $kMemberAttrTypeBody "aoce Member")
  271. (defconstant $kAdminsAttrTypeBody "aoce Administrators")
  272. (defconstant $kMailSlotsAttrTypeBody "aoce mailslots")
  273. (defconstant $kPrefMailAttrTypeBody "aoce pref mailslot")
  274. (defconstant $kAddressAttrTypeBody "aoce Address")
  275. (defconstant $kPictureAttrTypeBody "aoce Picture")
  276. (defconstant $kAuthKeyAttrTypeBody "aoce auth key")
  277. (defconstant $kTelephoneAttrTypeBody "aoce Telephone")
  278. (defconstant $kNBPNameAttrTypeBody "aoce NBP Name")
  279. (defconstant $kQMappingAttrTypeBody "aoce ForwarderQMap")
  280. (defconstant $kDialupSlotAttrTypeBody "aoce DialupSlotInfo")
  281. (defconstant $kHomeNetAttrTypeBody "aoce Home Internet")
  282. (defconstant $kCoResAttrTypeBody "aoce Co-resident M&M")
  283. (defconstant $kFwdrLocalAttrTypeBody "aoce FwdrLocalRecord")
  284. (defconstant $kConnectAttrTypeBody "aoce Connected To")
  285. (defconstant $kForeignAttrTypeBody "aoce Foreign RLIs")
  286. (defconstant $kOwnersAttrTypeBody "aoce Owners")
  287. (defconstant $kReadListAttrTypeBody "aoce ReadList")
  288. (defconstant $kWriteListAttrTypeBody "aoce WriteList")
  289. (defconstant $kDescriptorAttrTypeBody "aoce Descriptor")
  290. (defconstant $kCertificateAttrTypeBody "aoce Certificate")
  291. (defconstant $kMsgQsAttrTypeBody "aoce MessageQs")
  292. (defconstant $kPrefMsgQAttrTypeBody "aoce PrefMessageQ")
  293. (defconstant $kMasterPFAttrTypeBody "aoce MasterPF")
  294. (defconstant $kMasterNetSpecAttrTypeBody "aoce MasterNetSpec")
  295. (defconstant $kServersOfAttrTypeBody "aoce Servers Of")
  296. (defconstant $kParentCIDAttrTypeBody "aoce Parent CID")
  297. (defconstant $kNetworkSpecAttrTypeBody "aoce NetworkSpec")
  298. (defconstant $kLocationAttrTypeBody "aoce Location")
  299. (defconstant $kTimeSvrTypeAttrTypeBody "aoce TimeServer Type")
  300. (defconstant $kUpdateTimerAttrTypeBody "aoce Update Timer")
  301. (defconstant $kShadowsOfAttrTypeBody "aoce Shadows Of")
  302. (defconstant $kShadowServerAttrTypeBody "aoce Shadow Server")
  303. (defconstant $kTBSetupAttrTypeBody "aoce TB Setup")
  304. (defconstant $kMailSetupAttrTypeBody "aoce Mail Setup")
  305. (defconstant $kSlotIDAttrTypeBody "aoce SlotID")
  306. (defconstant $kGatewayFileIDAttrTypeBody "aoce Gateway FileID")
  307. (defconstant $kMailServiceAttrTypeBody "aoce Mail Service")
  308. (defconstant $kStdSlotInfoAttrTypeBody "aoce Std Slot Info")
  309. (defconstant $kAssoDirectoryAttrTypeBody "aoce Asso. Directory")
  310. (defconstant $kDirectoryAttrTypeBody "aoce Directory")
  311. (defconstant $kDirectoriesAttrTypeBody "aoce Directories")
  312. (defconstant $kSFlagsAttrTypeBody "aoce SFlags")
  313. (defconstant $kLocalNameAttrTypeBody "aoce Local Name")
  314. (defconstant $kLocalKeyAttrTypeBody "aoce Local Key")
  315. (defconstant $kDirUserRIDAttrTypeBody "aoce Dir User RID")
  316. (defconstant $kDirUserKeyAttrTypeBody "aoce Dir User Key")
  317. (defconstant $kDirNativeNameAttrTypeBody "aoce Dir Native Name")
  318. (defconstant $kCommentAttrTypeBody "aoce Comment")
  319. (defconstant $kRealNameAttrTypeBody "aoce Real Name")
  320. (defconstant $kPrivateDataAttrTypeBody "aoce Private Data")
  321. (defconstant $kDirTypeAttrTypeBody "aoce Directory Type")
  322. (defconstant $kDSAMFileAliasAttrTypeBody "aoce DSAM File Alias")
  323. (defconstant $kCanAddressToAttrTypeBody "aoce Can Address To")
  324. (defconstant $kDiscriminatorAttrTypeBody "aoce Discriminator")
  325. (defconstant $kAliasAttrTypeBody "aoce Alias")
  326. (defconstant $kParentMSAMAttrTypeBody "aoce Parent MSAM")
  327. (defconstant $kParentDSAMAttrTypeBody "aoce Parent DSAM")
  328. (defconstant $kSlotAttrTypeBody "aoce Slot")
  329. (defconstant $kAssoMailServiceAttrTypeBody "aoce Asso. Mail Service")
  330. (defconstant $kFakeAttrTypeBody "aoce Fake")
  331. (defconstant $kInheritSysAdminAttrTypeBody "aoce Inherit SysAdministrators")
  332. (defconstant $kPreferredPDAttrTypeBody "aoce Preferred PD")
  333. (defconstant $kLastLoginAttrTypeBody "aoce Last Login")
  334. (defconstant $kMailerAOMStateAttrTypeBody "aoce Mailer AOM State")
  335. (defconstant $kMailerSendOptionsAttrTypeBody "aoce Mailer Send Options")
  336. (defconstant $kJoinedAttrTypeBody "aoce Joined")
  337. (defconstant $kUnconfiguredAttrTypeBody "aoce Unconfigured")
  338. (defconstant $kVersionAttrTypeBody "aoce Version")
  339. (defconstant $kLocationNamesAttrTypeBody "aoce Location Names")
  340. (defconstant $kActiveAttrTypeBody "aoce Active")
  341. (defconstant $kDeleteRequestedAttrTypeBody "aoce Delete Requested")
  342. (defconstant $kGatewayTypeAttrTypeBody "aoce Gateway Type")
  343.  
  344. ;  Miscellaneous enums: 
  345.  
  346. (defconstant $kRString32Size 32);  max size of the body field in RString32 
  347. (defconstant $kRString64Size 64);  max size of the body field in RString64 
  348. (defconstant $kNetworkSpecMaxBytes 32);  max size of the body field in NetworkSpec 
  349. (defconstant $kPathNameMaxBytes 1024);  max size of the data field in PackedPathName 
  350. (defconstant $kDirectoryNameMaxBytes 32);  max size of the body field in DirectoryName 
  351. (defconstant $kAttributeTypeMaxBytes 32);  max size of the body field in AttributeType 
  352. (defconstant $kAttrValueMaxBytes 65536);  max size of any attribute value 
  353. (defconstant $kRStringMaxBytes 256);  max size (bytes: in) of the body field of a recordName or recordType 
  354. (defconstant $kRStringMaxChars 128);  max size (chars: in) of the body field of a recordName or recordType 
  355.  
  356. (defconstant $kNULLDNodeNumber 0);  Special value meaning none specified 
  357. (defconstant $kRootDNodeNumber 2);  DNodeNum corresponding to the root of the tree 
  358.  
  359. ; This enum is used to select the kind of RString in calls such as OCERelRString,
  360. ; OCEEqualRString, and OCEValidRString.
  361. ; eGenericSensitive and eGenericInsensitive are enumerators that can be used if you
  362. ; use RStrings for things other than what you see in this file.  If you want them to
  363. ; be compared in a case- and diacritical-sensitive manner (c ≠ C ≠ ç), use
  364. ; eGenericSensitive.  If you want them to be compared in a case- and diacritical-
  365. ; insensitive manner (c = C = ç), use eGenericInensitive.
  366. ; WARNING:  do not use eGenericSensitive and eGenericInsensitive with directory
  367. ; names, entity names, pathname parts, entity types, network specs, or attribute
  368. ; types!  Don't assume that you know how they should be compared!!!
  369.  
  370. ;  values of RStringKind 
  371.  
  372. (defconstant $kOCEDirName 0)
  373. (defconstant $kOCERecordOrDNodeName 1)
  374. (defconstant $kOCERecordType 2)
  375. (defconstant $kOCENetworkSpec 3)
  376. (defconstant $kOCEAttrType 4)
  377. (defconstant $kOCEGenericSensitive 5)
  378. (defconstant $kOCEGenericInsensitive 6)
  379.  
  380. (def-mactype :RSTRINGKIND (find-mactype :SIGNED-INTEGER))
  381.  
  382. ;  Values for the signature field in Discriminator 
  383.  
  384. ;  values of OCEDirectoryKind 
  385.  
  386. (defconstant $kDirAllKinds 0)
  387. (defconstant $kDirADAPKind :|adap|)
  388. (defconstant $kDirPersonalDirectoryKind :|pdir|)
  389. (defconstant $kDirDSAMKind :|dsam|)
  390.  
  391. (def-mactype :OCEDIRECTORYKIND (find-mactype :SIGNED-LONG))
  392.  
  393. ;  Values returned by GetDSSpecInfo() 
  394.  
  395. (defconstant $kOCEInvalidDSSpec :|????|);  could not be determined 
  396. (defconstant $kOCEDirsRootDSSpec :|root|);  root of all catalogs ("Catalogs" icon) 
  397. (defconstant $kOCEDirectoryDSSpec :|dire|);  catalog 
  398. (defconstant $kOCEDNodeDSSpec :|dnod|);  d-node 
  399. (defconstant $kOCERecordDSSpec :|reco|);  record 
  400. (defconstant $kOCEentnDSSpec :|entn|);  extensionType is 'entn' 
  401. (defconstant $kOCENOTentnDSSpec :|not |);  extensionType is not 'entn' 
  402.  
  403. ;  Values for AttributeTag 
  404. (defconstant $typeRString :|rstr|)
  405. (defconstant $typePackedDSSpec :|dspc|)
  406. (defconstant $typeBinary :|bnry|)
  407.  
  408. ; Bit flag corresponding to the isCluster bit.  Use it like this:
  409. ;     if (foo & kCanContainRecordsBit)
  410. ;         then this is a cluster!
  411. ; kForeignNode is used to indicate nodes in the name hierarchy that correspond to
  412. ; foreign directories (meaning ADAP sees no clusters or DNodes beneath it, but
  413. ; mail routers might be able to route to clusters beneath it.
  414.  
  415. (defconstant $kCanContainRecordsBit 0)
  416. (defconstant $kForeignNodeBit 1)
  417.  
  418. ;  values of DirNodeKind 
  419. (defconstant $kCanContainRecords #X1); 1<<kCanContainRecordsBit
  420. (defconstant $kForeignNode #X2) ; 1<<kForeignNodeBit
  421.  
  422. (def-mactype :DIRNODEKIND (find-mactype :SIGNED-LONG))
  423.  
  424. ; *** Toolbox Control ***
  425.  
  426. ; We will have a version number and attributes for toolboxes off the aa5e trap
  427. ; and the S&F server trap.
  428. ; This includes the OCE toolbox and S&F Server.  [Note: the S&F server will
  429. ; change to ONLY service ServerGateway calls —it will then be necessary to run
  430. ; it co–resident with an OCE toolbox].
  431. ; The high order word will represent the S&F Server version number.  The low
  432. ; order word will represent the OCE toolbox version number.  These will be zero
  433. ; until the component is up and running.  It is not possible to know these
  434. ; a–priori. Note: there will not be a seperate version numbers for each component
  435. ; in the OCE toolbox or S&F server.
  436. ; The above is consistent with the standard System 7.0 usage of Gestalt.
  437. ; The oce tb attribute gestaltOCETBPresent implies the existence of OCE on a
  438. ; machine.
  439. ; The OCE TB attribute gestaltOCETBAvailable implies the availablity of OCE calls.
  440. ; The attribute gestaltOCESFServerAvailable implies the availablity of OCE calls
  441. ; available through the S&F server. This are essentially the server gateway calls.
  442. ; Any (future) remaining OCE attributes may not be established correctly until
  443. ; the attribute gestaltOCETBAvailable is set.
  444. ; The gestalt selectors and values are listed below:
  445.  
  446. (defconstant $gestaltOCEToolboxVersion :|ocet|);  OCE Toolbox version 
  447. (defconstant $gestaltOCEToolboxAttr :|oceu|);  OCE Toolbox attributes 
  448.  
  449. ;  version includes:
  450. ;  *  dirtb
  451. ;  *  authtb
  452. ;  *  mailtb
  453. ;  *  ipmtb
  454. ;  *  personal directory
  455. ;  *  ADSPSecure
  456. ;  * e.g. all interfaces dependent on the aa5e trap.
  457. (defconstant $gestaltOCETB #X100);  OCE Toolbox version 1.0 
  458. (defconstant $gestaltSFServer #X100);  S&F Server version 1.0 
  459. (defconstant $gestaltOCETBPresent #X1);  OCE toolbox is present, not running 
  460. (defconstant $gestaltOCETBAvailable #X2);  OCE toolbox is running and available 
  461. (defconstant $gestaltOCESFServerAvailable #X4);  S&F Server is running and available 
  462.  
  463. ;     Constants used for Transitions. 
  464.  
  465. (defconstant $ATTransIPMStart :|ipms|)
  466. (defconstant $ATTransIPMShutdown :|ipmd|)
  467. (defconstant $ATTransDirStart :|dirs|)
  468. (defconstant $ATTransDirShutdown :|dird|)
  469. (defconstant $ATTransAuthStart :|auts|)
  470. (defconstant $ATTransAuthShutdown :|autd|)
  471. (defconstant $ATTransSFStart :|s&fs|)
  472. (defconstant $ATTransSFShutdown :|s&fd|)
  473.  
  474. ;  Some definitions for time-related parameters: 
  475.  
  476. (def-mactype :UTCTIME (find-mactype :SIGNED-LONG));  Interpreted as UTC seconds since 1/1/1904 
  477. (def-mactype :UTCOFFSET (find-mactype :SIGNED-LONG));  seconds EAST of Greenwich 
  478.  
  479. (def-mactype :CHARACTERSET (find-mactype :SIGNED-INTEGER));  This is the same as the ScriptManager script. 
  480.  
  481. ; *** RString ***
  482.  
  483. ; struct RString is a maximum-sized structure.  Allocate one of these and it will
  484. ; hold any valid RString.
  485.  
  486. (defrecord RStringHeader 
  487.   (charSet :SIGNED-INTEGER)
  488.   (dataLength :SIGNED-INTEGER)
  489.   )
  490.  
  491. (defrecord RString 
  492.   (charSet :SIGNED-INTEGER)
  493.   (dataLength :SIGNED-INTEGER)
  494.   
  495.   (body (:ARRAY :UNSIGNED-BYTE 256));  place for characters { (:ARRAY :UNSIGNED-BYTE (- #$KRSTRINGMAXBYTES 1 -1)) }
  496.   )
  497.  
  498. ;  struct ProtoRString is a minimum-sized structure.  Use this for a variable-length
  499. ; RString. 
  500.  
  501. (defrecord ProtoRString         ;  proto-RString used for variable length rStrings 
  502.   (charSet :SIGNED-INTEGER)
  503.   (dataLength :SIGNED-INTEGER)
  504.   
  505.   ;  Followed by body 
  506.   )
  507.  
  508. (def-mactype :RSTRINGPTR (find-mactype :POINTER))
  509. (def-mactype :RSTRINGHANDLE (find-mactype :HANDLE))
  510. (def-mactype :PROTORSTRINGPTR (find-mactype :POINTER))
  511.  
  512. (defconstant $kMinPackedRStringLength (RECORD-LENGTH PROTORSTRING))
  513.  
  514. (defrecord RString64 
  515.   (charSet :SIGNED-INTEGER)
  516.   (dataLength :SIGNED-INTEGER)
  517.   
  518.   (body (:ARRAY :UNSIGNED-BYTE 64))        ; { (:ARRAY :UNSIGNED-BYTE (- #$KRSTRING64SIZE 1 -1)) }
  519.   )
  520.  
  521. (defrecord RString32 
  522.   (charSet :SIGNED-INTEGER)
  523.   (dataLength :SIGNED-INTEGER)
  524.   
  525.   (body (:ARRAY :UNSIGNED-BYTE 32))       ;  { (:ARRAY :UNSIGNED-BYTE (- #$KRSTRING32SIZE 1 -1)) }
  526.   )
  527.  
  528. (def-mactype :RSTRING32PTR (find-mactype :POINTER))
  529.  
  530. ; Standard definitions for the entity type field and attribute type
  531. ; have been moved to the end of the file.
  532.  
  533. ; Copies str1 to str2.  str2Length is the size of str2, excluding header.
  534. ; A memFull error will be returned if that is not as large as str1->length.
  535.  
  536.  
  537. (deftrap _ocecopyrstring ((str1 (:pointer :rstring)) (str2 (:pointer :rstring)) (str2length :signed-integer))
  538.          (:stack :signed-integer)
  539.   (:stack-trap #xAA5C :d0 776 str1 str2 str2length))
  540.  
  541. ;     Make an RString from a C STRING.  If the c STRING is bigger than rStrLength,
  542. ; only rStrLength bytes will be copied. (rStrLength does not include the header size) 
  543.  
  544.  
  545. (deftrap _ocectorstring ((cstr :pointer) (charset :signed-integer) (rstr (:pointer :rstring)) (rstrlength :signed-integer))
  546.          nil
  547.   (:stack-trap #xAA5C :d0 825 cstr charset rstr rstrlength))
  548.  
  549. ;     Make an RString from a Pascal STRING.  If the Pascal STRING is bigger than rStrLength,
  550. ; only rStrLength bytes will be copied. (rStrLength does not include the header size) 
  551.  
  552.  
  553. (deftrap _oceptorstring ((pstr (:string 255)) (charset :signed-integer) (rstr (:pointer :rstring)) (rstrlength :signed-integer))
  554.          nil
  555.   (:stack-trap #xAA5C :d0 826 pstr charset rstr rstrlength))
  556.  
  557. ;     Make a Pascal STRING from an RString.  It's up to you to check the CHAR set of
  558. ; the RString, or if the length of the RString is greater than 255 (the Pascal STRING's
  559. ; length will simply be the lower byte of the RString's length).  The StringPtr that is
  560. ; returned will point directly into the RString (no memory will be allocated). 
  561.  
  562.  
  563. (deftrap _ocertopstring ((rstr (:pointer :rstring)))
  564.          (:stack (:pointer (:string 255)))
  565.   (:stack-trap #xAA5C :d0 827 rstr))
  566.  
  567. ;     Check the relative equality of two RStrings.  Determines if str1 is greater than,
  568. ; equal to, or less than str2.  Result types for OCERelRString are defined in <OSUtils.h>
  569. ; (same as for RelString). 
  570.  
  571.  
  572. (deftrap _ocerelrstring ((str1 :pointer) (str2 :pointer) (kind :signed-integer))
  573.          (:stack :signed-integer)
  574.   (:stack-trap #xAA5C :d0 813 str1 str2 kind))
  575.  
  576. ;     Check for equality of two RStrings. Returns true if equal. 
  577.  
  578.  
  579. (deftrap _oceequalrstring ((str1 :pointer) (str2 :pointer) (kind :signed-integer))
  580.          (:stack :boolean)
  581.   (:stack-trap #xAA5C :d0 790 str1 str2 kind))
  582.  
  583. ;     Check the validity of an RString.  Returns true if the RString is valid 
  584.  
  585.  
  586. (deftrap _ocevalidrstring ((str :pointer) (kind :signed-integer))
  587.          (:stack :boolean)
  588.   (:stack-trap #xAA5C :d0 824 str kind))
  589.  
  590. ; *** CreationID ***
  591.  
  592. (defrecord CreationID 
  593.   (source :SIGNED-LONG)        ;  Fields definitions and usage are not defined 
  594.   (seq :SIGNED-LONG)
  595.   )
  596.  
  597. (%define-record :ATTRIBUTECREATIONID (find-record-descriptor :CREATIONID))
  598. (def-mactype :CREATIONIDPTR (find-mactype :POINTER))
  599.  
  600. ;  Returns a pointer to a null CreationID . 
  601.  
  602.  
  603. (deftrap _ocenullcid nil
  604.          (:stack (:pointer :creationid))
  605.   (:stack-trap #xAA5C :d0 836))
  606.  
  607. ;  Returns a pointer to a special CreationID used within the PathFinder. 
  608.  
  609.  
  610. (deftrap _ocepathfindercid nil
  611.          (:stack (:pointer :creationid))
  612.   (:stack-trap #xAA5C :d0 828))
  613.  
  614. ;  Sets the CreationID to a null value. 
  615.  
  616.  
  617. (deftrap _ocesetcreationidtonull ((cid (:pointer :creationid)))
  618.          nil
  619.   (:stack-trap #xAA5C :d0 814 cid))
  620.  
  621. ;  Copies the value of cid1 to cid2. 
  622.  
  623.  
  624. (deftrap _ocecopycreationid ((cid1 :creationid) (cid2 (:pointer :creationid)))
  625.          nil
  626.   (:stack-trap #xAA5C :d0 768 cid1 cid2))
  627.  
  628. ;  Check the equality of two CreationIDs. 
  629.  
  630.  
  631. (deftrap _oceequalcreationid ((cid1 :creationid) (cid2 :creationid))
  632.          (:stack :boolean)
  633.   (:stack-trap #xAA5C :d0 780 cid1 cid2))
  634.  
  635. ; *** NetworkSpec ***
  636.  
  637. ; For the record, a NetworkSpec is an RString with a smaller maximum size.
  638. ; I don't justtypedef it to an RString, because I want the definition of the NetworkSpec
  639. ; struct to contain the max length.  But it should be possible to typecast any
  640. ; NetworkSpec to an RString and use all the RString utilities on it.
  641.  
  642. (defrecord NetworkSpec 
  643.   (charSet :SIGNED-INTEGER)
  644.   (dataLength :SIGNED-INTEGER)
  645.   
  646.   (body (:ARRAY :UNSIGNED-BYTE 32));  always fixed at the max size { (:ARRAY :UNSIGNED-BYTE (- #$KNETWORKSPECMAXBYTES 1 -1)) }
  647.   )
  648.  
  649. (def-mactype :NETWORKSPECPTR (find-mactype :POINTER))
  650.  
  651. ; *** PackedPathName ***
  652.  
  653. ; struct PackedPathName is a maximum-sized structure.  Allocate one of
  654. ; these and it will hold any valid packed pathname.
  655.  
  656. (defrecord PackedPathNameHeader 
  657.   (dataLength :SIGNED-INTEGER) ;  length excludes the space for the length field 
  658.   )
  659.  
  660. (defconstant $kPathNameMaxBytesMinusSizeofInteger 1022)
  661.  
  662. (defrecord PackedPathName 
  663.   (dataLength :SIGNED-INTEGER)
  664.   
  665.   (data (:ARRAY :UNSIGNED-BYTE 1022))          ;  { (:ARRAY :UNSIGNED-BYTE (- #$KPATHNAMEMAXBYTESMINUSSIZEOFINTEGER 1 -1)) }
  666.   )
  667.  
  668. ; struct ProtoPackedPathName is a minimum-sized structure.  Use this
  669. ; for a variable-length packed PathName.
  670.  
  671. (defrecord ProtoPackedPathName 
  672.    (dataLength :SIGNED-INTEGER)
  673.  
  674. ;  Followed by data 
  675.    )
  676.  
  677. (def-mactype :PACKEDPATHNAMEPTR (find-mactype :POINTER))
  678. (def-mactype :PROTOPACKEDPATHNAMEPTR (find-mactype :POINTER))
  679.  
  680. ; Copy the contents of path1 to path2.  path2Length is the size of path2, and must
  681. ; be large enough to hold a copy of path1.  A memFull error will be returned if that
  682. ; is not the case.
  683.  
  684.  
  685. (deftrap _ocecopypackedpathname ((path1 (:pointer :packedpathname)) (path2 (:pointer :packedpathname)) (path2length :signed-integer))
  686.    (:stack :signed-integer)
  687.    (:stack-trap #xAA5C :d0 772 path1 path2 path2length))
  688.  
  689. ; Returns true if packed path pointer is nil, or is of zero length, or is of
  690. ; length 2 and nParts of zero.
  691.  
  692.  
  693. (deftrap _oceisnullpackedpathname ((path (:pointer :packedpathname)))
  694.    (:stack :boolean)
  695.    (:stack-trap #xAA5C :d0 797 path))
  696.  
  697. ; OCEUnpackPathName breaks apart the path into its component RStrings, writing STRING
  698. ; pointers into the array 'parts', which the client asserts can hold as many as
  699. ; 'nParts' elements. The number of parts actually found is returned.  STRINGs are
  700. ; placed in the array in order from lowest to highest.  The first pathName element
  701. ; beneath the root appears last.  NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO
  702. ; THE PACKED STRUCT - DON'T DELETE OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED
  703. ; WITH THE UNPACKED STRUCT AS WELL
  704.  
  705.  
  706. (deftrap _oceunpackpathname ((path (:pointer :packedpathname)) (parts (:pointer (:pointer :rstring))) (nparts :signed-integer))
  707.    (:stack :signed-integer)
  708.    (:stack-trap #xAA5C :d0 816 path parts nparts))
  709.  
  710. ; OCEPackedPathNameSize computes the number of bytes of memory needed to hold a
  711. ; PackedPathName manufactured from the array of parts.  This length
  712. ; includes the length of the length field of PackedPathName, so it
  713. ; is safe to do a NewPtr (OCEPackedPathNameSize(...)).
  714.  
  715.  
  716. (deftrap _ocepackedpathnamesize ((parts (:pointer (:pointer :rstring))) (nparts :signed-integer))
  717.    (:stack :signed-integer)
  718.    (:stack-trap #xAA5C :d0 808 parts nparts))
  719.  
  720. ;  OCEDNodeNameCount returns the number of RStrings contained within the path. 
  721.  
  722.  
  723. (deftrap _ocednodenamecount ((path (:pointer :packedpathname)))
  724.    (:stack :signed-integer)
  725.    (:stack-trap #xAA5C :d0 812 path))
  726.  
  727. ; OCEPackPathName packs the parts into the storage provided as 'path'.  path must be
  728. ; large enough to hold the packed pathname.  A memFull error will be returned if
  729. ; pathLength is too small.  parts[0] should contain the deepest pathName element,
  730. ; and parts[nParts - 1] should contain the name of the first pathName element beneath
  731. ; the root.
  732.  
  733.  
  734. (deftrap _ocepackpathname ((parts (:pointer (:pointer :rstring))) (nparts :signed-integer) (path (:pointer :packedpathname)) (pathlength :signed-integer))
  735.    (:stack :signed-integer)
  736.    (:stack-trap #xAA5C :d0 803 parts nparts path pathlength))
  737.  
  738. ; Check the equality of two packed paths.
  739.  
  740.  
  741. (deftrap _oceequalpackedpathname ((path1 (:pointer :packedpathname)) (path2 (:pointer :packedpathname)))
  742.    (:stack :boolean)
  743.    (:stack-trap #xAA5C :d0 785 path1 path2))
  744.  
  745. ; OCEValidPackedPathName checks that the packed PathName is internally consistent.
  746. ; Returns true if it's ok.
  747.  
  748.  
  749. (deftrap _ocevalidpackedpathname ((path (:pointer :packedpathname)))
  750.    (:stack :boolean)
  751.    (:stack-trap #xAA5C :d0 820 path))
  752.  
  753. ; *** DirDiscriminator ***
  754.  
  755. (defrecord DirDiscriminator 
  756.    (signature :SIGNED-LONG)
  757.    (misc :SIGNED-LONG)
  758.    )
  759.  
  760. ;  Copies the value of disc1 to disc2. 
  761.  
  762.  
  763. (deftrap _ocecopydirdiscriminator ((disc1 :dirdiscriminator) (disc2 (:pointer :dirdiscriminator)))
  764.    nil
  765.    (:stack-trap #xAA5C :d0 769 disc1 disc2))
  766.  
  767. ;  Check the equality of two DirDiscriminators. 
  768.  
  769.  
  770. (deftrap _oceequaldirdiscriminator ((disc1 :dirdiscriminator) (disc2 :dirdiscriminator))
  771.    (:stack :boolean)
  772.    (:stack-trap #xAA5C :d0 781 disc1 disc2))
  773.  
  774. ; ********************************************************************************
  775. ; This structure is called RLI because it really contains all the info you
  776. ; need to locate a record within the entire name space.  It contains four fields.
  777. ; The first two are the name of the directory and a directory discriminator.  These
  778. ; two fields are used to indicate to which directory a given record belongs.  The
  779. ; discriminator is used to distinguish between two different directories that have
  780. ; the same name.
  781. ; The other two fields in the RLI structure are used to indicate a particular
  782. ; directory node within the directory specified by the directoryName and
  783. ; discriminator fields.  These fields are exactly analagous to the dirID and
  784. ; pathname used in HFS.  It is possible to specify a dNode just by dNodeNumber
  785. ; (pathname is nil), or just by pathname (dNodeNumber is set to kNULLDNodeNumber),
  786. ; or by a combination of the two.  The latter is called a 'partial pathname', and
  787. ; while it is valid in the Directory Manager API, it is not supported by ADAP
  788. ; directories in Release 1.
  789. ; Note that the path parameter does not include the directory name, but holds
  790. ; the names of all the nodes on the path to the desired directory node, starting
  791. ; with the directory node and working its way up the tree.
  792. ;  ********************************************************************************
  793.  
  794. ; *** RLI ***
  795.  
  796. (defrecord DirectoryName 
  797.    (charSet :SIGNED-INTEGER)
  798.    (dataLength :SIGNED-INTEGER)
  799.  
  800.    (body (:ARRAY :UNSIGNED-BYTE 32));  space for directory name  { (:ARRAY :UNSIGNED-BYTE (- #$KDIRECTORYNAMEMAXBYTES 1 -1)) }
  801.    )
  802.  
  803. (def-mactype :DIRECTORYNAMEPTR (find-mactype :POINTER))
  804.  
  805. (def-mactype :DNODENUM (find-mactype :SIGNED-LONG));  Directory node number 
  806.  
  807. (defrecord RLI                  ;  Record Location Info structure: 
  808.    (directoryName (:POINTER :DIRECTORYNAME));  pointer to the name of the directory root 
  809.    (discriminator :DIRDISCRIMINATOR);  used to discriminate between dup dir names 
  810.    (dNodeNumber :SIGNED-LONG)   ;  number of the node 
  811.    (path (:POINTER :PACKEDPATHNAME));  old-style RLI 
  812.    )
  813.  
  814. (def-mactype :RLIPTR (find-mactype :POINTER))
  815.  
  816. ; Create a new RLI from the directory name, discriminator, DNode number, and
  817. ; PackedPathName.  You must allocate the storage for the RLI and pass in a pointer
  818. ; to it.
  819.  
  820.  
  821. (deftrap _ocenewrli ((newrli (:pointer :rli)) (dirname (:pointer :directoryname)) (discriminator (:pointer :dirdiscriminator)) (dnodenumber :signed-long) (path (:pointer :packedpathname)))
  822.    nil
  823.    (:stack-trap #xAA5C :d0 799 newrli dirname discriminator dnodenumber path))
  824.  
  825. ; Duplicate the contents of rli1 to rli2.  No errors are returned. This
  826. ; simply copies the pointers to the directory name and path, wiping out any pointer
  827. ; that you might have had in there.
  828.  
  829.  
  830. (deftrap _oceduplicaterli ((rli1 :rli) (rli2 (:pointer :rli)))
  831.    nil
  832.    (:stack-trap #xAA5C :d0 779 rli1 rli2))
  833.  
  834. ; Copy the contents of rli1 to rli2.  rli2 must already contain
  835. ; pointers to structures large enough to hold copies of the corresponding
  836. ; fields from rli1.  A memFull error will be returned if that is not the case.
  837. ; So if you allocate a brand new empty destination, you must at least set up
  838. ; its length fields.
  839.  
  840.  
  841. (deftrap _ocecopyrli ((rli1 :rli) (rli2 (:pointer :rli)))
  842.    (:stack :signed-integer)
  843.    (:stack-trap #xAA5C :d0 775 rli1 rli2))
  844.  
  845. ; Check the equality of two RLIs.  This will take into account differences
  846. ; in the case and diacriticals of the directoryName and the PathName.
  847. ; NOTE THAT THIS WILL FAIL IF rli1 CONTAINS A DNODENUMBER AND A NIL PATHNAME,
  848. ; AND rli2 CONTAINS kNULLDNodeNumber AND A NON-NIL PATHNAME.  IN OTHER WORDS,
  849. ; THE TWO rlis MUST BE OF THE SAME FORM TO CHECK FOR EQUALITY.
  850. ; The one exception is that if the pathname is nil, a dNodeNumber of zero and
  851. ; kRootDNodeNumber will be treated as equal.
  852.  
  853.  
  854. (deftrap _oceequalrli ((rli1 :rli) (rli2 :rli))
  855.    (:stack :boolean)
  856.    (:stack-trap #xAA5C :d0 789 rli1 rli2))
  857.  
  858. ; Check the validity of an RLI.  This checks that the directory name length
  859. ; is within bounds, and the packed pathname (specified: if) is valid.
  860.  
  861.  
  862. (deftrap _ocevalidrli ((therli :rli))
  863.    (:stack :boolean)
  864.    (:stack-trap #xAA5C :d0 823 therli))
  865.  
  866. ; *** PackedRLI ***
  867.  
  868. ; struct PackedRLI is a maximum-sized structure.  Allocate one of
  869. ; these and it will hold any valid packed pathname.
  870.  
  871. (defconstant $kRLIMaxBytes 1296)
  872.  
  873. (defrecord PackedRLIHeader 
  874.    (dataLength :SIGNED-INTEGER) ;  length excludes the space for the length field 
  875.    )
  876.  
  877. (defrecord PackedRLI 
  878.    (dataLength :SIGNED-INTEGER)
  879.  
  880.    (data (:ARRAY :UNSIGNED-BYTE 1296))         ;  { (:ARRAY :UNSIGNED-BYTE (- #$KRLIMAXBYTES 1 -1)) }
  881.    )
  882.  
  883. ; struct ProtoPackedRLI is a minimum-sized structure.  Use this
  884. ; for a variable-length packed RLI.
  885.  
  886. (defrecord ProtoPackedRLI 
  887.    (dataLength :SIGNED-INTEGER)
  888.  
  889. ;  Followed by data 
  890.    )
  891.  
  892. (def-mactype :PACKEDRLIPTR (find-mactype :POINTER))
  893. (def-mactype :PROTOPACKEDRLIPTR (find-mactype :POINTER))
  894.  
  895. (defconstant $kMinPackedRLISize (+ (RECORD-LENGTH PROTOPACKEDRLI) (+ (RECORD-LENGTH DIRDISCRIMINATOR) (+ (RECORD-LENGTH DNODENUM) (+ #$KMINPACKEDRSTRINGLENGTH (RECORD-LENGTH PROTOPACKEDPATHNAME))))))
  896.  
  897. ; Copy the contents of prli1 to prli2.  prli2Length is the size of prli2, and must
  898. ; be large enough to hold a copy of prli1.  A memFull error will be returned if that
  899. ; is not the case.
  900.  
  901.  
  902. (deftrap _ocecopypackedrli ((prli1 (:pointer :packedrli)) (prli2 (:pointer :packedrli)) (prli2length :signed-integer))
  903.    (:stack :signed-integer)
  904.    (:stack-trap #xAA5C :d0 773 prli1 prli2 prli2length))
  905.  
  906. ; OCEUnpackRLI breaks apart the prli into its components, writing pointers into
  907. ; the rli structure.  NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE
  908. ; PACKED STRUCT - DON'T DELETE OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED
  909. ; WITH THE UNPACKED STRUCT AS WELL
  910.  
  911.  
  912. (deftrap _oceunpackrli ((prli (:pointer :packedrli)) (therli (:pointer :rli)))
  913.    nil
  914.    (:stack-trap #xAA5C :d0 817 prli therli))
  915.  
  916. ; OCEPackedRLISize computes the number of bytes of memory needed to hold a
  917. ; PackedRLI manufactured from an RLI.  This length
  918. ; includes the length of the length field of PackedRLI, so it
  919. ; is safe to do a NewPtr (OCEPackedRLISize(...)).
  920.  
  921.  
  922. (deftrap _ocepackedrlisize ((therli :rli))
  923.    (:stack :signed-integer)
  924.    (:stack-trap #xAA5C :d0 810 therli))
  925.  
  926. ; OCEPackRLI packs the RLI into the storage provided as 'prli'.  prli must be
  927. ; large enough to hold the packed RLI.  A memFull error will be returned if
  928. ; prliLength is too small.
  929.  
  930.  
  931. (deftrap _ocepackrli ((therli :rli) (prli (:pointer :packedrli)) (prlilength :signed-integer))
  932.    (:stack :signed-integer)
  933.    (:stack-trap #xAA5C :d0 804 therli prli prlilength))
  934.  
  935. ; OCEPackedRLIPartsSize computes the number of bytes of memory needed to hold a
  936. ; PackedRLI manufactured from the parts of an RLI.  This length
  937. ; includes the length of the length field of PackedRLI, so it
  938. ; is safe to do a NewPtr (OCEPackedRLIPartsSize(...)).
  939.  
  940.  
  941. (deftrap _ocepackedrlipartssize ((dirname (:pointer :directoryname)) (parts (:pointer (:pointer :rstring))) (nparts :signed-integer))
  942.    (:stack :signed-integer)
  943.    (:stack-trap #xAA5C :d0 809 dirname parts nparts))
  944.  
  945. ; OCEPackRLIParts packs the parts of an RLI into the storage provided as 'prli'.
  946. ; prli must be large enough to hold the packed RLI.  A memFull error will be returned
  947. ; if prliLength is too small.
  948.  
  949.  
  950. (deftrap _ocepackrliparts ((dirname (:pointer :directoryname)) (discriminator :dirdiscriminator) (dnodenumber :signed-long) (parts (:pointer (:pointer :rstring))) (nparts :signed-integer) (prli (:pointer :packedrli)) (prlilength :signed-integer))
  951.    (:stack :signed-integer)
  952.    (:stack-trap #xAA5C :d0 805 dirname discriminator dnodenumber parts nparts prli prlilength))
  953.  
  954. ; Check the equality of two packed prlis.
  955.  
  956.  
  957. (deftrap _oceequalpackedrli ((prli1 (:pointer :packedrli)) (prli2 (:pointer :packedrli)))
  958.    (:stack :boolean)
  959.    (:stack-trap #xAA5C :d0 787 prli1 prli2))
  960.  
  961. ; Check the validity of a packed RLI.  This checks that the directory name length
  962. ; is within bounds, and the packed pathname (specified: if) is valid.
  963.  
  964.  
  965. (deftrap _ocevalidpackedrli ((prli (:pointer :packedrli)))
  966.    (:stack :boolean)
  967.    (:stack-trap #xAA5C :d0 822 prli))
  968.  
  969. ; If this packed RLI describes a Personal Directory, this call will return a pointer
  970. ; to an alias record that can be used to find the actual file.  Otherwise, it returns nil.
  971.  
  972.  
  973. (deftrap _oceextractalias ((prli (:pointer :packedrli)))
  974.    (:stack :aliasptr)
  975.    (:stack-trap #xAA5C :d0 792 prli))
  976.  
  977. ; This call returns a pointer to a packed RLI that represents the "Catalogs" icon, or
  978. ; the root of all directories.  It is used in the CollabPack.
  979.  
  980.  
  981. (deftrap _ocegetdirectoryrootpackedrli nil
  982.    (:stack (:pointer :packedrli))
  983.    (:stack-trap #xAA5C :d0 838))
  984.  
  985. ; *** LocalRecordID ***
  986.  
  987. (defrecord LocalRecordID 
  988.    (cid :CREATIONID)
  989.    (recordName (:POINTER :RSTRING))
  990.    (recordType (:POINTER :RSTRING))
  991.    )
  992.  
  993. (def-mactype :LOCALRECORDIDPTR (find-mactype :POINTER))
  994.  
  995. ;  Create a LocalRecordID from a name, type, and CreationID 
  996.  
  997.  
  998. (deftrap _ocenewlocalrecordid ((recordname (:pointer :rstring)) (recordtype (:pointer :rstring)) (cid :creationid) (lrid (:pointer :localrecordid)))
  999.    nil
  1000.    (:stack-trap #xAA5C :d0 798 recordname recordtype cid lrid))
  1001.  
  1002. ; Copy LocalRecordID lRID1 to LocalRecordID lRID2.  lRID2 must already contain
  1003. ; pointers to RString structures large enough to hold copies of the corresponding
  1004. ; fields from lRID1.  A memFull error will be returned if that is not the case.
  1005. ; So if you allocate a brand new empty destination, you must at least set up
  1006. ; its length field.
  1007.  
  1008.  
  1009. (deftrap _ocecopylocalrecordid ((lrid1 :localrecordid) (lrid2 (:pointer :localrecordid)))
  1010.    (:stack :signed-integer)
  1011.    (:stack-trap #xAA5C :d0 770 lrid1 lrid2))
  1012.  
  1013. ; Check the equality of two local RIDs.
  1014.  
  1015.  
  1016. (deftrap _oceequallocalrecordid ((lrid1 :localrecordid) (lrid2 :localrecordid))
  1017.    (:stack :boolean)
  1018.    (:stack-trap #xAA5C :d0 783 lrid1 lrid2))
  1019.  
  1020. ; *** ShortRecordID ***
  1021.  
  1022. (defrecord ShortRecordID 
  1023.    (rli (:POINTER :PACKEDRLI))
  1024.    (cid :CREATIONID)
  1025.    )
  1026.  
  1027. (def-mactype :SHORTRECORDIDPTR (find-mactype :POINTER))
  1028.  
  1029. ;  Create a ShortRecordID from an RLI struct and a CreationID 
  1030.  
  1031.  
  1032. (deftrap _ocenewshortrecordid ((therli (:pointer :packedrli)) (cid :creationid) (srid (:pointer :shortrecordid)))
  1033.    nil
  1034.    (:stack-trap #xAA5C :d0 801 therli cid srid))
  1035.  
  1036. ; Copy ShortRecordID sRID1 to ShortRecordID sRID2.  sRID2 must already contain
  1037. ; pointers to structures large enough to hold copies of the corresponding
  1038. ; fields from sRID1.  A memFull error will be returned if that is not the case.
  1039. ; So if you allocate a brand new empty destination, you must at least set up
  1040. ; its length fields.
  1041.  
  1042.  
  1043. (deftrap _ocecopyshortrecordid ((srid1 :shortrecordid) (srid2 (:pointer :shortrecordid)))
  1044.    (:stack :signed-integer)
  1045.    (:stack-trap #xAA5C :d0 778 srid1 srid2))
  1046.  
  1047. ; Check the equality of two INTEGER RIDs.
  1048.  
  1049.  
  1050. (deftrap _oceequalshortrecordid ((srid1 :shortrecordid) (srid2 :shortrecordid))
  1051.    (:stack :boolean)
  1052.    (:stack-trap #xAA5C :d0 791 srid1 srid2))
  1053.  
  1054. ; *** RecordID ***
  1055.  
  1056. (defrecord RecordID 
  1057.    (rli (:POINTER :PACKEDRLI))  ;  pointer to a packed rli structure 
  1058.    (local :LOCALRECORDID)
  1059.    )
  1060.  
  1061. (def-mactype :RECORDIDPTR (find-mactype :POINTER))
  1062.  
  1063. ;     Create a RecordID from a packed RLI struct and a LocalRecordID.
  1064. ; This doesn't allocate any new space; the RecordID points to the same
  1065. ; packed RLI struct and the same name and type RStrings. 
  1066.  
  1067.  
  1068. (deftrap _ocenewrecordid ((therli (:pointer :packedrli)) (lrid :localrecordid) (rid (:pointer :recordid)))
  1069.    nil
  1070.    (:stack-trap #xAA5C :d0 800 therli lrid rid))
  1071.  
  1072. ; Copy RecordID RID1 to RecordID RID2.  RID2 must already contain
  1073. ; pointers to structures large enough to hold copies of the corresponding
  1074. ; fields from lRID1.  A memFull error will be returned if that is not the case.
  1075. ; So if you allocate a brand new empty destination, you must at least set up
  1076. ; its length fields.
  1077.  
  1078.  
  1079. (deftrap _ocecopyrecordid ((rid1 :recordid) (rid2 :recordid))
  1080.    (:stack :signed-integer)
  1081.    (:stack-trap #xAA5C :d0 777 rid1 rid2))
  1082.  
  1083. ;     Check the equality of two RIDs. 
  1084.  
  1085.  
  1086. (deftrap _oceequalrecordid ((rid1 :recordid) (rid2 :recordid))
  1087.    (:stack :boolean)
  1088.    (:stack-trap #xAA5C :d0 788 rid1 rid2))
  1089.  
  1090. ; *** PackedRecordID ***
  1091.  
  1092. ; struct PackedRecordID is a maximum-sized structure.  Allocate one of
  1093. ; these and it will hold any valid packed RecordID.
  1094.  
  1095. (defconstant $kPackedRecordIDMaxBytes 1824)
  1096.  
  1097. (defrecord PackedRecordIDHeader 
  1098.    (dataLength :SIGNED-INTEGER) ;  length excludes the space for the length field 
  1099.    )
  1100.  
  1101. (defrecord PackedRecordID 
  1102.    (dataLength :SIGNED-INTEGER)
  1103.  
  1104.    (data (:ARRAY :UNSIGNED-BYTE 1824))      ;  { (:ARRAY :UNSIGNED-BYTE (- #$KPACKEDRECORDIDMAXBYTES 1 -1)) }
  1105.    )
  1106.  
  1107. ; struct ProtoPackedRecordID is a minimum-sized structure.  Use this
  1108. ; for a variable-length packed RecordID.
  1109.  
  1110. (defrecord ProtoPackedRecordID 
  1111.    (dataLength :SIGNED-INTEGER)
  1112.  
  1113. ;  Followed by data 
  1114.    )
  1115.  
  1116. (def-mactype :PACKEDRECORDIDPTR (find-mactype :POINTER))
  1117. (def-mactype :PROTOPACKEDRECORDIDPTR (find-mactype :POINTER))
  1118.  
  1119. ; Copy PackedRecordID pRID1 to PackedRecordID pRID2.  pRID2 must already contain
  1120. ; pointers to structures large enough to hold copies of the corresponding
  1121. ; fields from pRID1.  A memFull error will be returned if that is not the case.
  1122. ; pRID2Length is the number of bytes that can be put into pRID2, not counting the
  1123. ; packed RecordID header.
  1124.  
  1125.  
  1126. (deftrap _ocecopypackedrecordid ((prid1 (:pointer :packedrecordid)) (prid2 (:pointer :packedrecordid)) (prid2length :signed-integer))
  1127.    (:stack :signed-integer)
  1128.    (:stack-trap #xAA5C :d0 774 prid1 prid2 prid2length))
  1129.  
  1130. ; Create a RecordID from a PackedRecordID.
  1131. ; NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE PACKED STRUCT - DON'T DELETE
  1132. ; OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED WITH THE UNPACKED STRUCT AS WELL
  1133.  
  1134.  
  1135. (deftrap _oceunpackrecordid ((prid (:pointer :packedrecordid)) (rid (:pointer :recordid)))
  1136.    nil
  1137.    (:stack-trap #xAA5C :d0 818 prid rid))
  1138.  
  1139. ; Create a PackedRecordID from a RecordID.  pRID must be large enough to contain
  1140. ; the packed RecordID.  A memFull error will be returned if that is not the case.
  1141. ; packedRecordIDLength is the number of bytes that can be put into pRID, not
  1142. ; counting the header.
  1143.  
  1144.  
  1145. (deftrap _ocepackrecordid ((rid :recordid) (prid (:pointer :packedrecordid)) (packedrecordidlength :signed-integer))
  1146.    (:stack :signed-integer)
  1147.    (:stack-trap #xAA5C :d0 806 rid prid packedrecordidlength))
  1148.  
  1149. ; Compute the number of bytes of memory needed to hold a RecordID when packed. This
  1150. ; length includes the length of the length field of PackedRecordID, so it
  1151. ; is safe to do a NewPtr (OCEPackedRecordIDSize(...)).
  1152.  
  1153.  
  1154. (deftrap _ocepackedrecordidsize ((rid :recordid))
  1155.    (:stack :signed-integer)
  1156.    (:stack-trap #xAA5C :d0 811 rid))
  1157.  
  1158. ; Check the equality of two packed RIDs.
  1159.  
  1160.  
  1161. (deftrap _oceequalpackedrecordid ((prid1 (:pointer :packedrecordid)) (prid2 (:pointer :packedrecordid)))
  1162.    (:stack :boolean)
  1163.    (:stack-trap #xAA5C :d0 786 prid1 prid2))
  1164.  
  1165. ;  OCEValidPackedRecordID checks the validity of a packed record ID. 
  1166.  
  1167.  
  1168. (deftrap _ocevalidpackedrecordid ((prid (:pointer :packedrecordid)))
  1169.    (:stack :boolean)
  1170.    (:stack-trap #xAA5C :d0 821 prid))
  1171.  
  1172. ; *** DSSpec ***
  1173.  
  1174. (defrecord DSSpec 
  1175.    (entitySpecifier (:POINTER :RECORDID))
  1176.    (extensionType :OSTYPE)
  1177.    (extensionSize :SIGNED-INTEGER)
  1178.    (extensionValue :POINTER)
  1179.    )
  1180.  
  1181. (def-mactype :DSSPECPTR (find-mactype :POINTER))
  1182.  
  1183. ; struct PackedDSSpec is NOT a maximum-sized structure.  Allocate one of
  1184. ; these and it will hold any valid packed RecordID, but not necessarily any additional
  1185. ; data.
  1186.  
  1187. (defconstant $kPackedDSSpecMaxBytes 1832)
  1188.  
  1189. (defrecord PackedDSSpecHeader 
  1190.    (dataLength :SIGNED-INTEGER) ;  length excludes the space for the length field 
  1191.    )
  1192.  
  1193. (defrecord PackedDSSpec 
  1194.    (dataLength :SIGNED-INTEGER)
  1195.  
  1196.    (data (:ARRAY :UNSIGNED-BYTE 1832))        ;  { (:ARRAY :UNSIGNED-BYTE (- #$KPACKEDDSSPECMAXBYTES 1 -1)) }
  1197.    )
  1198.  
  1199. ; struct ProtoPackedDSSpec is a minimum-sized structure.  Use this
  1200. ; for a variable-length packed DSSpec.
  1201.  
  1202. (defrecord ProtoPackedDSSpec 
  1203.    (dataLength :SIGNED-INTEGER)
  1204.  
  1205. ;  Followed by data 
  1206.    )
  1207.  
  1208. (def-mactype :PACKEDDSSPECPTR (find-mactype :POINTER))
  1209. (def-mactype :PROTOPACKEDDSSPECPTR (find-mactype :POINTER))
  1210.  
  1211. ; Copy PackedDSSpec pdss1 to PackedDSSpec pdss2.  pdss2 must already contain
  1212. ; pointers to structures large enough to hold copies of the corresponding
  1213. ; fields from pdss1.  A memFull error will be returned if that is not the case.
  1214. ; pdss2Length is the number of bytes that can be put into pdss2, not counting the
  1215. ; packed DSSpec header.
  1216.  
  1217.  
  1218. (deftrap _ocecopypackeddsspec ((pdss1 (:pointer :packeddsspec)) (pdss2 (:pointer :packeddsspec)) (pdss2length :signed-integer))
  1219.    (:stack :signed-integer)
  1220.    (:stack-trap #xAA5C :d0 771 pdss1 pdss2 pdss2length))
  1221.  
  1222. ; Create a DSSpec from a PackedDSSpec.
  1223. ; NOTE THAT THE UNPACKED STRUCT CONTAINS POINTERS INTO THE PACKED STRUCT - DON'T DELETE
  1224. ; OR REUSE THE PACKED STRUCT UNTIL YOU ARE FINISHED WITH THE UNPACKED STRUCT AS WELL.
  1225. ; A pointer to the extension is returned in dss->extensionValue, and the length of that
  1226. ; extension is returned in dss->extensionSize.  If there is no extension, dss->extensionValue will
  1227. ; be set to nil.  This routine will unpack the RecordID (any: if) into rid, unpack the rest
  1228. ; into dss, and set dss->entitySpecifier to rid.
  1229.  
  1230.  
  1231. (deftrap _oceunpackdsspec ((pdss (:pointer :packeddsspec)) (dss (:pointer :dsspec)) (rid (:pointer :recordid)))
  1232.    nil
  1233.    (:stack-trap #xAA5C :d0 815 pdss dss rid))
  1234.  
  1235. ; Create a PackedDSSpec from a DSSpec.  pdss must be large enough to
  1236. ; contain the packed RecordID and any extension.  A memFull error will be returned if that
  1237. ; is not the case.  pdssLength is the number of bytes that can be put into pdss,
  1238. ; not counting the header.
  1239.  
  1240.  
  1241. (deftrap _ocepackdsspec ((dss :dsspec) (pdss (:pointer :packeddsspec)) (pdsslength :signed-integer))
  1242.    (:stack :signed-integer)
  1243.    (:stack-trap #xAA5C :d0 802 dss pdss pdsslength))
  1244.  
  1245. ; Compute the number of bytes of memory needed to hold a DSSpec when packed. This
  1246. ; length includes the length of the length field of PackedDSSpec, so it
  1247. ; is safe to do a NewPtr (OCEPackedDSSpecSize(...)).
  1248.  
  1249.  
  1250. (deftrap _ocepackeddsspecsize ((dss :dsspec))
  1251.    (:stack :signed-integer)
  1252.    (:stack-trap #xAA5C :d0 807 dss))
  1253.  
  1254. ;     Check the equality of two DSSpecs.  This compares all fields, even the
  1255. ; extension (unless extensionSize == 0).  The extensions are compared in a case-insensitive and
  1256. ; diacrit-insensitive manner. 
  1257.  
  1258.  
  1259. (deftrap _oceequaldsspec ((pdss1 :dsspec) (pdss2 :dsspec))
  1260.    (:stack :boolean)
  1261.    (:stack-trap #xAA5C :d0 782 pdss1 pdss2))
  1262.  
  1263. ;     Check the equality of two PackedDSSpecs.  This compares all fields, even the
  1264. ; extension (unless extensionSize == 0).  The extensions are compared in a case-insensitive and
  1265. ; diacrit-insensitive manner. 
  1266.  
  1267.  
  1268. (deftrap _oceequalpackeddsspec ((pdss1 (:pointer :packeddsspec)) (pdss2 (:pointer :packeddsspec)))
  1269.    (:stack :boolean)
  1270.    (:stack-trap #xAA5C :d0 784 pdss1 pdss2))
  1271.  
  1272. ; Check the validity of a PackedDSSpec.  If extensionType is
  1273. ; 'entn', pdss must contain a valid entitySpecifier.  For all other extensionTypes, a nil
  1274. ; entitySpecifier is valid, but if non-nil, it will be checked for validity.  No check
  1275. ; is made on the extension.
  1276.  
  1277.  
  1278. (deftrap _ocevalidpackeddsspec ((pdss (:pointer :packeddsspec)))
  1279.    (:stack :boolean)
  1280.    (:stack-trap #xAA5C :d0 819 pdss))
  1281.  
  1282. ; Return info about a DSSpec.  This routine does not check validity.  If the
  1283. ; DSSpec has no extension, we determine whether it represents the root of all
  1284. ; directories, a single directory, a DNode, or a Record.  Else it is invalid.
  1285. ; If the DSSpec has an extension, we simply return the extension type.
  1286.  
  1287.  
  1288. (deftrap _ocegetdsspecinfo ((spec :dsspec))
  1289.    (:stack :ostype)
  1290.    (:stack-trap #xAA5C :d0 793 spec))
  1291.  
  1292. ;  OCEGetExtensionType returns the extensionType imbedded in the PackedDSSpec. 
  1293.  
  1294.  
  1295. (deftrap _ocegetextensiontype ((pdss (:pointer :packeddsspec)))
  1296.    (:stack :ostype)
  1297.    (:stack-trap #xAA5C :d0 796 pdss))
  1298.  
  1299. ; OCEStreamPackedDSSpec streams (flattens) a directory object a little at a time by
  1300. ; calling the DSSpecStreamer routine that you provide.
  1301.  
  1302. (def-mactype :DSSPECSTREAMER (find-mactype :POINTER))
  1303. ;  FUNCTION DSSpecStreamer(VAR buffer: void; count: LONGINT; eof: BOOLEAN;
  1304. ;         userData: LONGINT): OSErr;
  1305.  
  1306.  
  1307. (deftrap _ocestreampackeddsspec ((dss :dsspec) (stream :pointer) (userdata :signed-long) (actualcount (:pointer :signed-long)))
  1308.    (:stack :signed-integer)
  1309.    (:stack-trap #xAA5C :d0 829 dss stream userdata actualcount))
  1310.  
  1311. ; *** AttributeType ***
  1312.  
  1313. ; For the record, an AttributeType is an RString with a smaller maximum size.
  1314. ; I don't justtypedef it to an RString, because I want the definition of the AttributeType
  1315. ; struct to contain the max length, because I need to include it in the Attribute struct
  1316. ; below.  But it should be possible to typecast any AttributeType to an RString and use
  1317. ; all the RString utilities on it.
  1318.  
  1319. (defrecord AttributeType 
  1320.    (charSet :SIGNED-INTEGER)
  1321.    (dataLength :SIGNED-INTEGER)
  1322.  
  1323.    (body (:ARRAY :UNSIGNED-BYTE 32))       ;  { (:ARRAY :UNSIGNED-BYTE (- #$KATTRIBUTETYPEMAXBYTES 1 -1)) }
  1324. ;  always fixed at the max size 
  1325.    )
  1326.  
  1327. (def-mactype :ATTRIBUTETYPEPTR (find-mactype :POINTER))
  1328.  
  1329. ; *** AttributeValue ***
  1330.  
  1331. (def-mactype :ATTRIBUTETAG (find-mactype :DESCTYPE));  same class as is used in AppleEvents 
  1332.  
  1333. (defrecord AttributeValue 
  1334.    (tag :DESCTYPE)
  1335.    (dataLength :SIGNED-LONG)
  1336.    (bytes :POINTER)
  1337.    )
  1338.  
  1339. (def-mactype :ATTRIBUTEVALUEPTR (find-mactype :POINTER))
  1340.  
  1341. ; *** Attribute ***
  1342.  
  1343. (defrecord Attribute 
  1344.    (AttributeType :ATTRIBUTETYPE)
  1345.    (cid :CREATIONID)
  1346.    (value :ATTRIBUTEVALUE)
  1347.    )
  1348.  
  1349. (def-mactype :ATTRIBUTEPTR (find-mactype :POINTER))
  1350.  
  1351.  
  1352. (deftrap _ocegetindrecordtype ((stringindex :signed-integer))
  1353.    (:stack (:pointer :rstring))
  1354.    (:stack-trap #xAA5C :d0 795 stringindex))
  1355.  
  1356.  
  1357. (deftrap _ocegetindattributetype ((stringindex :signed-integer))
  1358.    (:stack (:pointer :attributetype))
  1359.    (:stack-trap #xAA5C :d0 794 stringindex))
  1360.  
  1361. (defconstant _oceTBDispatch #XAA5E)
  1362.  
  1363. ; $ENDC                         ;  UsingOCE 
  1364.  
  1365. ; $IFC NOT UsingIncludes
  1366.  
  1367. ; $ENDC
  1368.  
  1369. (export '(_OCETBDISPATCH $KPACKEDDSSPECMAXBYTES $KPACKEDRECORDIDMAXBYTES
  1370.           $KMINPACKEDRLISIZE $KRLIMAXBYTES $KPATHNAMEMAXBYTESMINUSSIZEOFINTEGER
  1371.           $KMINPACKEDRSTRINGLENGTH $ATTRANSSFSHUTDOWN $ATTRANSSFSTART
  1372.           $ATTRANSAUTHSHUTDOWN $ATTRANSAUTHSTART $ATTRANSDIRSHUTDOWN
  1373.           $ATTRANSDIRSTART $ATTRANSIPMSHUTDOWN $ATTRANSIPMSTART
  1374.           $GESTALTOCESFSERVERAVAILABLE $GESTALTOCETBAVAILABLE
  1375.           $GESTALTOCETBPRESENT $GESTALTSFSERVER $GESTALTOCETB
  1376.           $GESTALTOCETOOLBOXATTR $GESTALTOCETOOLBOXVERSION $KFOREIGNNODE
  1377.           $KCANCONTAINRECORDS $KFOREIGNNODEBIT $KCANCONTAINRECORDSBIT
  1378.           $TYPEBINARY $TYPEPACKEDDSSPEC $TYPERSTRING $KOCENOTENTNDSSPEC
  1379.           $KOCEENTNDSSPEC $KOCERECORDDSSPEC $KOCEDNODEDSSPEC
  1380.           $KOCEDIRECTORYDSSPEC $KOCEDIRSROOTDSSPEC $KOCEINVALIDDSSPEC
  1381.           $KDIRDSAMKIND $KDIRPERSONALDIRECTORYKIND $KDIRADAPKIND $KDIRALLKINDS
  1382.           $KOCEGENERICINSENSITIVE $KOCEGENERICSENSITIVE $KOCEATTRTYPE
  1383.           $KOCENETWORKSPEC $KOCERECORDTYPE $KOCERECORDORDNODENAME $KOCEDIRNAME
  1384.           $KROOTDNODENUMBER $KNULLDNODENUMBER $KRSTRINGMAXCHARS
  1385.           $KRSTRINGMAXBYTES $KATTRVALUEMAXBYTES $KATTRIBUTETYPEMAXBYTES
  1386.           $KDIRECTORYNAMEMAXBYTES $KPATHNAMEMAXBYTES $KNETWORKSPECMAXBYTES
  1387.           $KRSTRING64SIZE $KRSTRING32SIZE $KGATEWAYTYPEATTRTYPEBODY
  1388.           $KDELETEREQUESTEDATTRTYPEBODY $KACTIVEATTRTYPEBODY
  1389.           $KLOCATIONNAMESATTRTYPEBODY $KVERSIONATTRTYPEBODY
  1390.           $KUNCONFIGUREDATTRTYPEBODY $KJOINEDATTRTYPEBODY
  1391.           $KMAILERSENDOPTIONSATTRTYPEBODY $KMAILERAOMSTATEATTRTYPEBODY
  1392.           $KLASTLOGINATTRTYPEBODY $KPREFERREDPDATTRTYPEBODY
  1393.           $KINHERITSYSADMINATTRTYPEBODY $KFAKEATTRTYPEBODY
  1394.           $KASSOMAILSERVICEATTRTYPEBODY $KSLOTATTRTYPEBODY
  1395.           $KPARENTDSAMATTRTYPEBODY $KPARENTMSAMATTRTYPEBODY $KALIASATTRTYPEBODY
  1396.           $KDISCRIMINATORATTRTYPEBODY $KCANADDRESSTOATTRTYPEBODY
  1397.           $KDSAMFILEALIASATTRTYPEBODY $KDIRTYPEATTRTYPEBODY
  1398.           $KPRIVATEDATAATTRTYPEBODY $KREALNAMEATTRTYPEBODY
  1399.           $KCOMMENTATTRTYPEBODY $KDIRNATIVENAMEATTRTYPEBODY
  1400.           $KDIRUSERKEYATTRTYPEBODY $KDIRUSERRIDATTRTYPEBODY
  1401.           $KLOCALKEYATTRTYPEBODY $KLOCALNAMEATTRTYPEBODY $KSFLAGSATTRTYPEBODY
  1402.           $KDIRECTORIESATTRTYPEBODY $KDIRECTORYATTRTYPEBODY
  1403.           $KASSODIRECTORYATTRTYPEBODY $KSTDSLOTINFOATTRTYPEBODY
  1404.           $KMAILSERVICEATTRTYPEBODY $KGATEWAYFILEIDATTRTYPEBODY
  1405.           $KSLOTIDATTRTYPEBODY $KMAILSETUPATTRTYPEBODY $KTBSETUPATTRTYPEBODY
  1406.           $KSHADOWSERVERATTRTYPEBODY $KSHADOWSOFATTRTYPEBODY
  1407.           $KUPDATETIMERATTRTYPEBODY $KTIMESVRTYPEATTRTYPEBODY
  1408.           $KLOCATIONATTRTYPEBODY $KNETWORKSPECATTRTYPEBODY
  1409.           $KPARENTCIDATTRTYPEBODY $KSERVERSOFATTRTYPEBODY
  1410.           $KMASTERNETSPECATTRTYPEBODY $KMASTERPFATTRTYPEBODY
  1411.           $KPREFMSGQATTRTYPEBODY $KMSGQSATTRTYPEBODY $KCERTIFICATEATTRTYPEBODY
  1412.           $KDESCRIPTORATTRTYPEBODY $KWRITELISTATTRTYPEBODY
  1413.           $KREADLISTATTRTYPEBODY $KOWNERSATTRTYPEBODY $KFOREIGNATTRTYPEBODY
  1414.           $KCONNECTATTRTYPEBODY $KFWDRLOCALATTRTYPEBODY $KCORESATTRTYPEBODY
  1415.           $KHOMENETATTRTYPEBODY $KDIALUPSLOTATTRTYPEBODY $KQMAPPINGATTRTYPEBODY
  1416.           $KNBPNAMEATTRTYPEBODY $KTELEPHONEATTRTYPEBODY $KAUTHKEYATTRTYPEBODY
  1417.           $KPICTUREATTRTYPEBODY $KADDRESSATTRTYPEBODY $KPREFMAILATTRTYPEBODY
  1418.           $KMAILSLOTSATTRTYPEBODY $KADMINSATTRTYPEBODY $KMEMBERATTRTYPEBODY
  1419.           $KAFPSERVICERECTYPEBODY $KOTHERSERVICERECTYPEBODY
  1420.           $KCOMBINEDRECTYPEBODY $KMAILSERVICERECTYPEBODY
  1421.           $KBUSINESSCARDRECTYPEBODY $KATTRIBUTEVALUERECTYPEBODY
  1422.           $KDSAMRECTYPEBODY $KMSAMRECTYPEBODY $KSETUPRECTYPEBODY
  1423.           $KDNODERECTYPEBODY $KDIRECTORYRECTYPEBODY $KSERVERSETUPRECTYPEBODY
  1424.           $KADAPDNODEREPRECTYPEBODY $KADAPDNODERECTYPEBODY
  1425.           $KADAPSERVERRECTYPEBODY $KNETWORKSPECRECTYPEBODY
  1426.           $KMNMFORWARDERRECTYPEBODY $KMNMRECTYPEBODY $KGROUPRECTYPEBODY
  1427.           $KUSERRECTYPEBODY $KNUMOCEATTRTYPES $KLASTOCEATTRTYPENUM
  1428.           $KFIRSTOCEATTRTYPENUM $KGATEWAYTYPEATTRTYPENUM
  1429.           $KDELETEREQUESTEDATTRTYPENUM $KACTIVEATTRTYPENUM
  1430.           $KLOCATIONNAMESATTRTYPENUM $KVERSIONATTRTYPENUM
  1431.           $KUNCONFIGUREDATTRTYPENUM $KJOINEDATTRTYPENUM
  1432.           $KMAILERSENDOPTIONSATTRTYPENUM $KMAILERAOMSTATEATTRTYPENUM
  1433.           $KLASTLOGINATTRTYPENUM $KPREFERREDPDATTRTYPENUM
  1434.           $KINHERITSYSADMINATTRTYPENUM $KFAKEATTRTYPENUM
  1435.           $KASSOMAILSERVICEATTRTYPENUM $KSLOTATTRTYPENUM
  1436.           $KPARENTDSAMATTRTYPENUM $KPARENTMSAMATTRTYPENUM $KALIASATTRTYPENUM
  1437.           $KDISCRIMINATORATTRTYPENUM $KCANADDRESSTOATTRTYPENUM
  1438.           $KDSAMFILEALIASATTRTYPENUM $KDIRTYPEATTRTYPENUM
  1439.           $KPRIVATEDATAATTRTYPENUM $KREALNAMEATTRTYPENUM $KCOMMENTATTRTYPENUM
  1440.           $KDIRNATIVENAMEATTRTYPENUM $KDIRUSERKEYATTRTYPENUM
  1441.           $KDIRUSERRIDATTRTYPENUM $KLOCALKEYATTRTYPENUM $KLOCALNAMEATTRTYPENUM
  1442.           $KSFLAGSATTRTYPENUM $KDIRECTORIESATTRTYPENUM $KDIRECTORYATTRTYPENUM
  1443.           $KASSODIRECTORYATTRTYPENUM $KSTDSLOTINFOATTRTYPENUM
  1444.           $KMAILSERVICEATTRTYPENUM $KGATEWAYFILEIDATTRTYPENUM
  1445.           $KSLOTIDATTRTYPENUM $KMAILSETUPATTRTYPENUM $KTBSETUPATTRTYPENUM
  1446.           $KSHADOWSERVERATTRTYPENUM $KSHADOWSOFATTRTYPENUM
  1447.           $KUPDATETIMERATTRTYPENUM $KTIMESVRTYPEATTRTYPENUM
  1448.           $KLOCATIONATTRTYPENUM $KNETWORKSPECATTRTYPENUM $KPARENTCIDATTRTYPENUM
  1449.           $KSERVERSOFATTRTYPENUM $KMASTERNETSPECATTRTYPENUM
  1450.           $KMASTERPFATTRTYPENUM $KPREFMSGQATTRTYPENUM $KMSGQSATTRTYPENUM
  1451.           $KCERTIFICATEATTRTYPENUM $KDESCRIPTORATTRTYPENUM
  1452.           $KWRITELISTATTRTYPENUM $KREADLISTATTRTYPENUM $KOWNERSATTRTYPENUM
  1453.           $KFOREIGNATTRTYPENUM $KCONNECTATTRTYPENUM $KFWDRLOCALATTRTYPENUM
  1454.           $KCORESATTRTYPENUM $KHOMENETATTRTYPENUM $KDIALUPSLOTATTRTYPENUM
  1455.           $KQMAPPINGATTRTYPENUM $KNBPNAMEATTRTYPENUM $KTELEPHONEATTRTYPENUM
  1456.           $KAUTHKEYATTRTYPENUM $KPICTUREATTRTYPENUM $KADDRESSATTRTYPENUM
  1457.           $KPREFMAILATTRTYPENUM $KMAILSLOTSATTRTYPENUM $KADMINSATTRTYPENUM
  1458.           $KMEMBERATTRTYPENUM $KNUMOCERECTYPES $KLASTOCERECTYPENUM
  1459.           $KFIRSTOCERECTYPENUM $KAFPSERVICERECTYPENUM $KOTHERSERVICERECTYPENUM
  1460.           $KCOMBINEDRECTYPENUM $KMAILSERVICERECTYPENUM $KBUSINESSCARDRECTYPENUM
  1461.           $KATTRIBUTEVALUERECTYPENUM $KDSAMRECTYPENUM $KMSAMRECTYPENUM
  1462.           $KSETUPRECTYPENUM $KDNODERECTYPENUM $KDIRECTORYRECTYPENUM
  1463.           $KSERVERSETUPRECTYPENUM $KADAPDNODEREPRECTYPENUM
  1464.           $KADAPDNODERECTYPENUM $KADAPSERVERRECTYPENUM $KNETWORKSPECRECTYPENUM
  1465.           $KMNMFORWARDERRECTYPENUM $KMNMRECTYPENUM $KGROUPRECTYPENUM
  1466.           $KUSERRECTYPENUM $KOCEGETROOTPACKEDRLI $KOCEGETACCESSCONTROLDSSPEC
  1467.           $KOCENULLCID $KOCESTREAMPACKEDDSSPEC $KOCEPATHFINDERCID
  1468.           $KOCERTOPSTRING $KOCEPTORSTRING $KOCECTORSTRING $KOCEVALIDRSTRING
  1469.           $KOCEVALIDRLI $KOCEVALIDPACKEDRLI $KOCEVALIDPACKEDRECORDID
  1470.           $KOCEVALIDPACKEDPATHNAME $KOCEVALIDPACKEDDSSPEC $KOCEUNPACKRECORDID
  1471.           $KOCEUNPACKRLI $KOCEUNPACKPATHNAME $KOCEUNPACKDSSPEC
  1472.           $KOCESETCREATIONIDTONULL $KOCERELRSTRING $KOCEDNODENAMECOUNT
  1473.           $KOCEPACKEDRECORDIDSIZE $KOCEPACKEDRLISIZE $KOCEPACKEDRLIPARTSSIZE
  1474.           $KOCEPACKEDPATHNAMESIZE $KOCEPACKEDDSSPECSIZE $KOCEPACKRECORDID
  1475.           $KOCEPACKRLIPARTS $KOCEPACKRLI $KOCEPACKPATHNAME $KOCEPACKDSSPEC
  1476.           $KOCENEWSHORTRECORDID $KOCENEWRECORDID $KOCENEWRLI
  1477.           $KOCENEWLOCALRECORDID $KOCEISNULLPACKEDPATHNAME $KOCEGETXTNTYPE
  1478.           $KOCEGETINDRECORDTYPE $KOCEGETINDATTRIBUTETYPE $KOCEGETDSSPECINFO
  1479.           $KOCEEXTRACTALIAS $KOCEEQUALSHORTRECORDID $KOCEEQUALRSTRING
  1480.           $KOCEEQUALRLI $KOCEEQUALRECORDID $KOCEEQUALPACKEDRLI
  1481.           $KOCEEQUALPACKEDRECORDID $KOCEEQUALPACKEDPATHNAME
  1482.           $KOCEEQUALPACKEDDSSPEC $KOCEEQUALLOCALRECORDID $KOCEEQUALDSSPEC
  1483.           $KOCEEQUALDIRDISCRIMINATOR $KOCEEQUALCREATIONID $KOCEDUPLICATERLI
  1484.           $KOCECOPYSHORTRECORDID $KOCECOPYRECORDID $KOCECOPYRSTRING
  1485.           $KOCECOPYRLI $KOCECOPYPACKEDRECORDID $KOCECOPYPACKEDRLI
  1486.           $KOCECOPYPACKEDPATHNAME $KOCECOPYPACKEDDSSPEC $KOCECOPYLOCALRECORDID
  1487.           $KOCECOPYDIRDISCRIMINATOR $KOCECOPYCREATIONID))
  1488. (provide-interface 'OCE)